feat: add DM notification preferences and code detection alerts#29
Merged
Conversation
✅ Coverage Report
New Files
Changed Files
|
There was a problem hiding this comment.
Pull request overview
Adds per-user DM notification preferences (code detected, redeem success, redeem failure) backed by three new boolean columns on users, a new /notifications slash command to view/update them, and DM fan-outs in the MessageCreate handler and auto-redeemer that respect the new flags.
Changes:
- Schema + migration
0005_grey_saracenaddingdm_on_code,dm_on_success,dm_on_failureand matchingUserCredentialsfields /getAllUsersWithDmOnCode+setNotificationPreferenceshelpers. - New
/notificationscommand (with/helpentry and registration inbot.ts). - DM fan-out on code detection in
MessageCreate, and gating of success/failure DMs inautoRedeemer.tson the new preferences.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/bot/database/schema/users.ts | Adds three boolean preference columns. |
| src/bot/database/migrations/0005_grey_saracen.sql | SQLite migration for the new columns. |
| src/bot/database/migrations/meta/0005_snapshot.json | Drizzle snapshot for migration 0005. |
| src/bot/database/migrations/meta/_journal.json | Registers the new migration entry. |
| src/bot/database/userManager.ts | Adds NotificationPreferences, defaults in row mapper, getAllUsersWithDmOnCode, and setNotificationPreferences. |
| src/bot/handlers/autoRedeemer.ts | Gates success DM on dmOnSuccess; sends failure DM when dmOnFailure is enabled. |
| src/bot/bot.ts | Registers /notifications and DMs opted-in users when codes are detected. |
| src/bot/commands/notifications.ts | New slash command to view/update preferences. |
| src/bot/commands/help.ts | Adds /notifications to the help embed. |
| IDEAS/TODO.md | Marks the DM/notification ideas as implemented. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Michael Cramer <michael@bigmichi1.de>
44500a7 to
eee2e86
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.